Declaration of internal variables in ST
Syntax |
---|
|
Meaning | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
declaration of one or more internal →variables (also known as "local variables"), Providing the optional keyword Use the optional keywords for visibility to define the visibility of all elements of this section. These keywords are possible within the declaration of a function block or the declaration of a class only.
The optional →pragmas A →data type is possible as type for a variable. See "Supported data types" to learn which data types are supported for the declaration of variables. Use the optional →initial value [
Local variables declared within a function block or a class are →static variables. Local variables declared within a function or a method are →temporary variables. |
Good to know |
---|
Moreover, Neuron Power Engineer allows you to define a not yet fully specified location for the declaration. See "Declaration of a language element with partial address in ST" for details. Moreover, Neuron Power Engineer allows you to specify additional data for the declaration. See "Defining description, comment, JSON string or type for variables or data types" for details.
Within a section |
Example 1: Different sections "VAR ... END_VAR" |
---|
|
Example 2: Function block with differently visible variables |
---|
|